<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>成都家政服务系统</title>
    <!-- Bootstrap core CSS -->
    <link href="{{asset('layui/css/layui.css')}}" rel="stylesheet" media="all">
    <link rel="stylesheet" href="{{asset('bootstrap/css/bootstrap.min.css')}}">
    <link rel="stylesheet" href="{{asset('bootstrap/css/dashboard.css')}}">
    <link rel="stylesheet" href="{{asset('bootstrap/css/bootstrap-theme.min.css')}}">
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="{{asset('layui/layui.js')}}" charset="utf-8"></script>
    <script src="{{asset('jquery.js')}}"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{{asset('bootstrap/js/bootstrap.min.js')}}"></script>
</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">成都家政服务系统</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">成都家政服务系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="javascript:;">{{session("employee_name")}}，欢迎您</a></li>
                <li><a href="javascript:;">职位：{{session("employee_power")}}</a></li>
                <li><a href="/adminLogout" style="color: red">退出</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-2 sidebar">
            <ul class="nav nav-sidebar">
                <li><a href="javascript:;" style="background-color: lightgrey"><h4><strong>人员</strong></h4></a></li>
                <li><a href="/areaMaster.searchEmployee">查看员工</a></li>
                <li><a href="/areaMaster.checkEmployee">审核申请</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="javascript:;" style="background-color: lightgrey"><h4><strong>任务</strong></h4></a></li>
                <li  class="active"><a href="/areaMaster.searchTask">任务管理</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="javascript:;" style="background-color: lightgrey"><h4><strong>财务</strong></h4></a></li>
                <li><a href="/areaMaster.searchMoney">财务统计</a></li>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="page-header">任务管理</h2>

            <div class="panel-body" >
                <div class="form-inline">
                    <div class="form-group">
                        <h4>当前区域：{{$nowArea}}</h4>
                    </div>
                    <form class="form-group container-fluid">
                        <div class="form-group">
                            <h4>时间段选择：</h4>
                        </div>
                        <div class="form-group">
                            <div class="layui-input-inline">
                                <input type="text" name="date" id="begin"  placeholder="起始时间" autocomplete="off" class="form-control" onclick="layui.laydate({elem: this})">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="layui-input-inline">
                                <input type="text" name="date" id="last"  placeholder="终止时间" autocomplete="off" class="form-control" onclick="layui.laydate({elem: this})">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-primary">确定</button>
                    </form>

                    <hr>
                    <div class="table-responsive">
                        <table class="table table-bordered table-responsive table-striped table-hover">
                            <thead>
                            <tr>
                                <th>发布时间</th>
                                <th>雇主</th>
                                <th>区域</th>
                                <th>金额</th>
                                <th>状态</th>
                                <th>详情</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($moneyData as $data)
                                <tr>
                                    <td scope="row">{{$data->task_time}}</td>
                                    <td>{{$data->customer_name}}</td>
                                    <td>{{$data->area_name}}</td>
                                    <td>{{$data->task_money}}</td>
                                    <td>{{$data->task_state_name}}</td>
                                    <td><a href="/areaMaster.searchTasks/{{$data->task_id}}" type="button" class="btn btn-info btn-block btn-sm">详情</a></td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        <hr>
                        <div class="bs-example" data-example-id="disabled-active-pagination">
                            <nav aria-label="...">
                                <ul class="pager">
                                    <li><a href="#">上一页</a></li>
                                    <li><a href="#">下一页</a></li>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form()
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate;

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function(value){
                if(value.length < 5){
                    return '标题至少得5个字符啊';
                }
            }
            ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });

        //监听提交
        form.on('submit(demo1)', function(data){
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });


    });
</script>
</body>
</html>